home *** CD-ROM | disk | FTP | other *** search
/ Pro Intralink 3.1 / Pro Intralink v3.1.iso / getpmt.csh next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2001-11-27  |  2.6 KB  |  94 lines

  1. #!/bin/csh -f
  2.  
  3. ###########################################################################
  4. # 02/05/93 James Created - get machine type using file/hinv/uname.
  5. # 02/12/93 James check for sun/solaris.
  6. # 03/01/93 James Fix for nec_risc r4000
  7. # 04/05/93 Pete  added alpha_unix
  8. # 04/17/93 James Removed quotes around hinv_out.
  9. # 06/21/93 jmichaud Allow for IRIX 5.0 sgi and sgi_r4k (ELF 32-bit).
  10. # 08/27/93 James sun4_solaris.
  11. # 11/17/93 James R4000->R4..0
  12. # 11/19/93 James IBM PowerPC fix.
  13. # 12/08/93 $$1 James hitachi.
  14. # 04/26/94 $$2 James handle jap sgi.
  15. # 05/16/95 $$3 Pete  set LANG C at top, all platforms work well with this
  16. # 06/22/95 $$4 true R4..0->R[48]..0 to allow for SGI R8000 systems.
  17. # 11/27/95 $$5 Pete  added sgi_elf2 for 5.3 and beyond
  18. # 02/01/96 $$6 Pete  added R5000 support for sgi (for Tom True)
  19. # 18-Jun-96 Pete   $$7  revised by Joe Michaud and tweaked by me
  20. # 20-Jun-96 Pete   $$8  fixed bug in previous subm comment block
  21. # 05-Dec-96 Pete   $$9  added hp8k
  22. # 30-Dec-96 Jane   $$10 distinguish hp700 and hp8k properly
  23. # 08-Sep-97 JJE    $$11 Just hp8k now for 19
  24. # 27-Mar-98 jmichaud $$12 added sgi_mips4
  25. # 08-Mar-00 MAZ           Get rid of env os_name
  26. # 04-Aug-00 TWH      $$13 Add hpux11_pa32
  27. # 01-Dec-00 TWH      $$14 Add sun4_solaris_64
  28. # 16-May-01 TWH      $$15 Add hpux_pa64
  29. # 15-Jul-01 MAZ      $$16 Introduce FORCE_PMT
  30. ###########################################################################
  31.  
  32. setenv LANG C
  33.  
  34. set id = "UNKNOWN"
  35.  
  36. switch (`uname -s`)
  37.     case "IRIX":
  38.     case "IRIX64":
  39.         set cpu = (`hinv -t cpu`)
  40.         if ("`expr $cpu[3] : 'R[23]*'`" > "1") then
  41.             # Not supported.
  42.         else if ("`expr $cpu[3] : 'R4*'`" > "1") then
  43.             set id = "sgi_elf2"
  44.         else
  45.             set id = "sgi_mips4"
  46.         endif
  47.     breaksw
  48.  
  49.     case "OSF1":
  50.         set id = "alpha_unix"
  51.     breaksw
  52.  
  53.     case "HP-UX":
  54.         set rev = `uname -r`
  55.         if ("`expr $rev : '[A-Z].11.*'`" > "1") then
  56.       if ("`file /stand/vmunix | grep 'ELF-64'`" == "") then
  57.             set id = "hpux11_pa32"
  58.           else
  59.             set id = "hpux_pa64"
  60.           endif
  61.         else
  62.             set id = "hp8k"
  63.         endif
  64.     breaksw
  65.  
  66.     case "AIX":
  67.         set id = "ibm_rs6000"
  68.     breaksw
  69.  
  70.     case "SunOS":
  71.         set rev = `isalist |grep sparcv9 | wc -c`
  72.         if ("$rev" > "0") then
  73.        set id = "sun4_solaris_64"
  74.         else
  75.            set id = "sun4_solaris"
  76.         endif
  77.     breaksw
  78.  
  79.     case "HI-UX":
  80.         set id = "hitachi"
  81.     breaksw
  82.  
  83.     case "UNIX_SV":
  84.         set id = "nec_mips"
  85.     breaksw
  86. endsw
  87.  
  88. if( $?FORCE_PMT ) then
  89.     echo $FORCE_PMT 
  90. else
  91.     echo $id 
  92. endif
  93.  
  94.